/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge.major;

import ru.jSkyRoom.interfaces.major.Dialog;
import ru.jSkyRoom.interfaces.major.DialogBranch;
import ru.jSkyRoom.interfaces.major.Quest;
import skyproc.DLBR;
import skyproc.FormID;

/**
 *
 * @author Rakev
 */
public class DialogBranchBridge extends MajorBridge<DLBR> implements DialogBranch {

    public DialogBranchBridge(DLBR adapting) {
        super(adapting);
    }

    @Override
    public Quest getQuest() {
        FormID id = getRawObject().getQuest();
        return getFinderFactory().createQuestFinder().find(id);
    }

    @Override
    public void setQuest(Quest quest) {
        FormID id = getIdProducer().produce(quest);
        getRawObject().setQuest(id);
    }

    @Override
    public Dialog getStartingTopic() {
        FormID id = getRawObject().getStartingTopic();
        return getFinderFactory().createDialogFinder().find(id);
    }

    @Override
    public void setStartingTopic(Dialog dialog) {
        FormID id = getIdProducer().produce(dialog);
        getRawObject().setStartingTopic(id);
    }
}
